package com.myzl.web.controller.visualization;

import com.myzl.coal.service.IRealTimeDataService;
import com.myzl.coal.service.IScaleService;
import com.myzl.common.core.domain.AjaxResult;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

/**
 *
 * @author cew
 * @date 2023年7月14日16:38:36
 */
@RestController
@Slf4j
@Data
@RequestMapping("/visualization/scale/")
public class ScaleController {

    private final IRealTimeDataService realTimeDataService;
    private final IScaleService scaleService;

    @GetMapping("/brokenLineData/{deviceId}")
    public AjaxResult brokenLineData(@PathVariable("deviceId") Integer deviceId) {
        return realTimeDataService.brokenLineData(deviceId);
    }

    @GetMapping("/reset")
    public AjaxResult reset(@RequestParam(defaultValue = "201") Integer deviceId) {
        return scaleService.resetScale(deviceId);
    }
}
